<!--支付宝支付页面-->
<template>
    <div>
        <div>
            订单号是：{{ this.$route.query.orderNo }}，应付金额：{{ this.$route.query.total }}
        </div>
        <div>
            <el-button type="danger" @click="pay">立即支付</el-button>
        </div>
        <div class="Graphicdetailsfooter" v-html="bodyFormHtml"></div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            bodyFormHtml: ''
        }
    },
    methods: {
        pay() {
            let url = 'http://localhost:5286/order/pay/test'
            this.$http.get(url).then(res => {
                this.bodyFormHtml = res.data.message

                this.$nextTick(() => {
                    console.log(document.forms)
                    document.forms[0].submit()
                })
            })
        }
    }
}
</script>